<button class="layui-btn-lg layui-btn-primary" id="signin">每日签到</button>
<script>
    layui.use(['jquery', 'admin', 'index'], function () {
        let admin = layui.admin;
        let index = layui.index;
        let userinfo;
        index.getUser(function (user) {
            userinfo = user;
        });
        // let $ = layui.jquery;
        $("#signin").click(function () {
            let data = {
                userId: userinfo.id,
                pointsRuleCode: "signIn"
            }
            admin.req("api-points/points/change?userId=" + userinfo.id + "&pointsRuleCode=signIn", {}, function (res) {
                console.log(res);
            }, "POST");
        })
    })
</script>